<?php
/**
* @version		1.0  - 	Joomla 1.5.x
* @package	Component Com Products
* @copyright	Wampvn Group
* @license		GNU/GPL
* @website          http://wampvn.com
* @description    tpl category.
*/

defined( '_JEXEC' ) or die( 'Restricted access' ); 
$document =& JFactory::getDocument();


$document->addStyleSheet($this->baseurl. '/components/com_igallery/css/colorbox.css');
$document->addScript($this->baseurl. '/components/com_igallery/javascript/jquery.colorbox.js');


?>
<script>
jQuery(document).ready(function(){
		//Examples of how to assign the ColorBox event to elements
		jQuery("a[rel='pro-img']").colorbox();
		jQuery('.wtip').hide();
	
						
	});
</script>
<h1 class="product_title">
    <?php echo JText::_('SAN_PHAM_CTY_HUNG_VUONG');?>
</h1>

<div class="content-block product">
	<div class="product-content">
		<div class="list_prod">
		<?php 
                foreach($this->listProduct as $aliasCatName => $list){
                    ?>
                    <div class="<?php echo $aliasCatName; ?>">
                            <h2 class="catproduct_title"><span><?php echo JText::_($aliasCatName); ?></span></h2>
                            <div class="<?php echo $aliasCatName ?>_product_content catproduct_ct">
                                <?php
                                foreach($list as $i => $pro){
                                    
                                    //Chọn image. if !exists => get default
                                    $filename = ProductViewCategory::checkImage($pro->id);
                                    if($filename && file_exists('images/products/'.$filename)){
                                            //$image = JURI::base().'images/products/thumbs/'. $filename;
                                            $image = JURI::base().'images/products/'. $filename;
                                            $thum = JURI::base().'images/products/thumbs/'. $filename;
                                            //$file = $filename;
                                    }else{
                                            //$file  = 'noimage.jpg';
                                            $image = JURI::base().'images/products/thumbs/noimage.jpg';
                                    }
                                    
                                    ?>
                                    <div class="khung_anh">
                                        <a href="<?php echo $image;?>" rel="pro-img" alt="#intro_pro_<?php echo $pro->id?>" class="img_frame">
                                                <img src="<?php echo $image;?>" />
                                        </a>
                                        <span class="khung_anh_title">
                                                <span><?php echo $pro->name; ?></span>
                                                <a href="<?php echo JRoute::_('index.php?option=com_contact&view=contact&id=1&Itemid=9') ?>" class="buy_cart"><img src="<?php echo JURI::base(); ?>templates/hungvuongpanga/images/buy_cart.jpg"></a>
                                        </span>
                                        <?php $filenames = ProductViewCategory::getImages($pro->id);
                                        if ($filenames)  {
                                                foreach ($filenames as $file) {
                                                        if (!$file->isdefault) { 
                                                                $image = JURI::base().'images/products/'. $file->filename;
                                                        ?>
                                                        <a href="<?php echo $image; ?>" rel="pro-img" style="display:none"></a>
                                                        <?php 
                                                        }//#foe:3
                                                }
                                        }//#if:1
                                        ?>

                                    </div>
                                    <?php
                                }//#foe:2
                                ?>
                                <div class="clearfix"></div>
                            </div>
                    </div>
                    
                    <?php
                }//#foe:1
		?>
		</div>
		<div class="clearfix"></div>
			
	</div><!--# .product-content -->
</div>


